﻿<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<meta name="viewport"
      content="width=device-width, initial-scale=1, shrink-to-fit=no, user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>个人中心</title>
<link href="//res.wx.qq.com/open/libs/weui/1.1.2/weui.min.css" rel="stylesheet">
<style>
    body {
        color: #333;
        background: #f2f2f2;
        font-size: 15px;
    }

    .header {
        position: relative;
        background: #333;
        color: #fff;
        padding: 20px;
        display: -webkit-flex;
        display: flex;
        -webkit-align-items: center;
        align-items: center;
    }

    .header__headimgurl {
        min-width: 60px;
        width: 60px;
        height: 60px;
        background: #eee;
        border-radius: 50%;
        -webkit-animation:rotateImg 15s linear infinite;
        vertical-align: middle;
    }

    @keyframes rotateImg {
        0% {transform : rotate(0deg);}
        100% {transform : rotate(360deg);}
    }

    @-webkit-keyframes rotateImg {
        0%{-webkit-transform : rotate(0deg);}
        100%{-webkit-transform : rotate(360deg);}
    }

    .header__info {
        -webkit-flex: 1;
        flex: 1;
        padding-left: 20px;
    }

    .header__uid {
        font-size: 16px;
    }

    .info {
        background: #333;
        color: #fff;
        display: -webkit-flex;
        display: flex;
        -webkit-align-items: center;
        align-items: center;
        padding-bottom: 20px;
    }

    .box {
        display: block;
        background: #fff;
        border-radius: 10px;
        margin: 0 15px 15px;
        box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
        overflow: hidden;
        color: inherit;
    }

    .box--first {
        margin-top: -20px;
    }

    .box__header {
        padding: 15px;
        border-bottom: 1px solid #eee;
        line-height: 1;
        display: -webkit-flex;
        display: flex;
        -webkit-align-items: center;
        align-items: center;
        -webkit-justify-content: space-between;
        justify-content: space-between;
        color: inherit;
    }

    .box__title {
        font-weight: bold;
        display: -webkit-flex;
        display: flex;
        -webkit-align-items: center;
        align-items: center;
    }

    .box__more {
        font-size: 12px;
        color: #aaa;
    }

    .box__content {
        padding: 15px;
    }

    .weui-btn {
        margin: 20px 15px;
        background: #333 !important;
    }

    .box__more {
        padding: 5px;
        border-radius: 4px;
        color: #fff;
        font-size: 14px;
        background: #333 !important;
    }

    .box__icon {
        width: 20px;
        height: 20px;
        margin-right: 5px;
    }

    .btn__box .weui-btn {
        margin-top: 0;
    }

    .yongjin {
        width: 100%;
    }

    .yongjin td, .yongjin th {
        text-align: center;
    }

</style>
</head>

<body>
<div class="header">
    <img class="header__headimgurl"
         th:src="${headImageUrl}"
         alt="">
    <div class="header__info">
        <div class="nickname" th:text="${nickname}"></div>

        <div class="header__uid">
            手机号:<span th:text="${phone}"></span>
            <span>
                    <a onclick="fun6()" href="javascript:void(0);" style="color: inherit;">[修改]</a>
            </span>
        </div>
    </div>
</div>

<div class="info"></div>
<div class="box box--first">
    <a class="box__header">
        <div class="box__title">
            <img class="box__icon"
                 src="../image/icon1.png"
                 alt="">公告
        </div>
    </a>
    <div class="box__content">
        <table style="width: 100%;">
            <tr th:each="notice,noticeStat : ${notice}">
                <td style="width: 20%" th:text="${#dates.format(notice.getCreateTime(),'yyyy-MM-dd')}"></td>
                <td style="width: 50%"><a style="color: #111111" th:href="${notice.getNoticeUrl()}"
                                          th:text="${notice.getName()}"></a></td>
            </tr>
        </table>
    </div>
</div>


<div class="box">
    <div class="box__header" onclick="fun()">
        <div class="box__title">
            <img class="box__icon"
                 src="../image/icon2.png">我的积分：<span th:text="${integration}"></span>
        </div>
        <div class="box__more">充值&raquo;</a></div>
    </div>
</div>
<div class="box">
    <div class="box__header" onclick="fun4()">
        <div class="box__title">
            <img class="box__icon"
                 src="../image/icon1.png">领取记录
        </div>
        <div class="box__more">累计优惠<span th:text="${totalMoney}"></span>元</div>
    </div>
</div>
<div class="box">
    <div class="box__header" onclick="fun5()">
        <div class="box__title">
            <img class="box__icon"
                 src="../image/icon1.png">积分流水
        </div>
    </div>
</div>
<div class="box">
    <div class="box__header" onclick="fun2()">
        <div class="box__title">
            <img class="box__icon"
                 src="../image/icon3.png">邀请记录
        </div>
        <div class="box__more">共邀请<span th:text="${inviteCount}"></span>人</div>
    </div>
</div>
<div class="box" th:if="${isLeader==1}">
    <div class="box__header" onclick="fun10()">
        <div class="box__title">
            <img class="box__icon"
                 src="../image/icon2.png">管理入口
        </div>
    </div>
</div>
<div class="box" th:if="${isCps==1}">
    <div class="box__header" onclick="fun11()">
        <div class="box__title">
            <img class="box__icon"
                 src="../image/icon2.png">CPS佣金
        </div>
    </div>
</div>
<div class="btns">
    <div class="btn__box">
        <a href="javascript:void(0);" onclick="fun9()" class="weui-btn weui-btn_primary" style="font-size: 14px; margin: 10px; margin-top: 0; white-space: nowrap">联系客服</a>
    </div>
</div>
<div style="text-align: center; font-size: 14px; margin-bottom: 20px; line-height: 1; margin-top: 10px;"
     onclick="updateOpenid()">这不是您当前登录的微信号？点击修复
</div>
<input id="platform" type="hidden" th:value="${platform}">
<input id="openId" type="hidden" th:value="${openId}">
<input id="recharge" type="hidden" th:value="${recharge}">
<input id="wChatUrl" type="hidden" th:value="${wChatUrl}">
</body>
</html>
<script>
    var platform = document.getElementById("platform").value;
    var openId = document.getElementById("openId").value;
    var recharge = document.getElementById("recharge").value;
    var wChatUrl = document.getElementById("wChatUrl").value;

    function fun() {
        window.location.href = recharge
    }

    function fun2() {
        window.location.href = '/inviteListView?platform=' + platform + '&openId=' + openId
    }

    function fun3() {
        window.location.href = '/rankingListView?platform=' + platform
    }

    function fun4() {
        window.location.href = '/luckyRecordView?openId=' + openId + '&platform=' + platform
    }

    function fun5() {
        window.location.href = '/integrationRecordView?openId=' + openId + '&platform=' + platform
    }

    function fun6() {
        alert("向公众号发送11位手机号即可")
    }

    function fun7() {
        window.location.href = '/commissionView?openId=' + openId + '&platform=' + platform
    }

    function fun8() {
        alert("提现功能一周内开放")
    }
    function fun9(){
        window.location.href = wChatUrl
    }
    function fun10() {
        window.location.href = '/remainingMoneyView?openId=' + openId
    }
    function fun11() {
        window.location.href = '/cpsMoneyView?platform=' + platform
    }
    function updateOpenid() {
        document.cookie = "OPENID_" + platform + "=; expires=" + new Date(2000, 1, 1).toString();
        window.location.href = '/infoView?platform=' + platform;
    }
</script>
